import 'package:flutter/cupertino.dart';
import 'package:flutter_application_1/models/recommend_interface.dart';

class UserList {
  late final List<UserItem> list;
  UserList(this.list);
  factory UserList.fromJson(List<dynamic> list) {
    return UserList(
      list.map((e) => UserItem.fromJson(e)).toList(),
    );
  }
}

class UserItem implements RecommendInterface {
  late final int id;
  late final String coverPictureUrl;
  late final String nickname;
  late final String type;
  late final int musicCount;
  late final int musicPlayCount;

  UserItem({
    required this.id,
    required this.coverPictureUrl,
    required this.nickname,
    required this.type,
    required this.musicCount,
    required this.musicPlayCount,
  });

  factory UserItem.fromJson(dynamic item) {
    return UserItem(
      id: item["id"],
      coverPictureUrl: item["coverPictureUrl"],
      nickname: item["nickname"],
      type: item["type"],
      musicCount: item["musicCount"],
      musicPlayCount: item["musicPlayCount"],
    );
  }
}
